<?php 
/*
* ----------------------------------------------------------------------------------------------------
* MENU FUNCTIONS
* @PACKAGE BY TT from THEMECENTER.NET
* ----------------------------------------------------------------------------------------------------
*/


/*------------------------------------------------------------------------
*Top Menu
------------------------------------------------------------------------*/
function TT_testmonial($title,$num_of_post = 3) 
{
$args	     = array(
			 'showposts' =>$num_of_post,
			 'orderby' =>'id',
			 'order' => 'desc',
			 'post_type' => 'testimonial'
			 );
$posts 		 = new WP_Query( $args );

$testimonial_enable_avata = get_theme_option('testimonial','testimonial_enable_avata');

$testimonial_enable_author = get_theme_option('testimonial','testimonial_enable_author');
$testimonial_enable_email = get_theme_option('testimonial','testimonial_enable_email'); 
$testimonial_enable_project = get_theme_option('testimonial','testimonial_enable_project');
$testimonial_enable_company =  get_theme_option('testimonial','testimonial_enable_company');
$testimonial_enable_address= get_theme_option('testimonial','testimonial_enable_address');

$return 	 = '
                     <div class="testimonial-box">
                     	<div class="arrow-top"><img src="'.IMAGE_URI.'/arrow_bottom.png" alt=""></div>';
while($posts->have_posts()) : $posts->the_post();
			     $testimonial_avata = get_meta_option('Testimonial_avata',get_the_ID());
			     $testimonial_author = get_meta_option('Testimonial_author_name',get_the_ID());
                 $testimonial_email = get_meta_option('Testimonial_email',get_the_ID());
                 $testimonial_project = get_meta_option('Testimonial_company',get_the_ID());
                 $testimonial_company = get_meta_option('Testimonial_company',get_the_ID());
                 $testimonial_address = get_meta_option('Testimonial_address',get_the_ID());
				 $Testimonial_content = get_meta_option('Testimonial_content',get_the_ID());
			     
                 $return .=  '  <blockquote>
                        <p>';
						if($testimonial_enable_avata == "true"): $return.='<img class="avata" src="'.THEME_URI.'/timthumb.php?src='.$testimonial_avata.'&amp;h=60&amp;w=60&amp;zc=1" style="float:left;"/>'; endif;
				 $return .= $Testimonial_content;
				 		if($testimonial_enable_email == "true") : $return.='<br />Email : '.$testimonial_email; endif;
						if($testimonial_enable_project == "true") : $return.='<br />Project : '.$testimonial_project; endif;
						if($testimonial_enable_company == "true") : $return.='<br />Company : '.$testimonial_company; endif;
						if($testimonial_enable_address == "true") : $return.='<br />Address : '.$testimonial_address; endif;
				 $return .='</p>';
				 
				 $return .='<cite>'.get_meta_option('Testimonial_author_name',get_the_ID()).'</cite>';                        
                 $return .='   </blockquote>';
endwhile;					

$return.='            <div class="clearfix">&nbsp;</div>
                    </div>
'; 

return $return;
}


?>